<?php
class Rss_model extends Model
{

	function __construct()
	{
		parent::factory();
	}


	function getFeed($limit)
	{
		$data = array();
		
		$sql = "
			(SELECT id, title,body, date, blog_item FROM t_blog)
			UNION 
			(SELECT id, title, body, date, blog_item FROM t_portfolio) ORDER BY date DESC, id DESC LIMIT 0,$limit
		";
		
		return parent::$db->getAll($sql);
		
	}

	function __destruct(){}
}
?>